package main

import (
	_ "fmt"
	_ "gf-app/boot"
	// g "gf-app/frame/g"
	"fmt"
	_ "gf-app/router/micro"
	_ "gf-app/router/web"
	gin "github.com/gin-gonic/gin"
	gf "github.com/gogf/gf/frame/g"
	"github.com/micro/go-micro/v2/web"
	"log"
)

func main() {
	//g.Server().Run()
	serverName := gf.Cfg().GetString("micro.Name")
	serverPort := gf.Cfg().GetString("micro.Address")

	engine := gin.Default()
	service := web.NewService(
		web.Name(serverName),
		web.Address(fmt.Sprintf("%v", serverPort)),
		web.Handler(engine),
	)
	service.Init()

	if err := service.Run(); err != nil {
		log.Fatal(err)
	}
}
